package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.vo.Catelog2Vo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.CategoryEntity;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author shiyefei
 * @email 1336182731@qq.com
 * @date 2021-12-20 15:22:10
 */
public interface CategoryService extends IService<CategoryEntity> {

    @Cacheable(value = {"category"}, key = "#root.method.name", sync = true)
    List<CategoryEntity> getLevel1Categorys();

    PageUtils queryPage(Map<String, Object> params);

    List<CategoryEntity> listWithTree();

    void removeMenusByIds(List<Long> asList);

    Long[] findCategoryPath(Long catelogId);

    void updateByCascade(CategoryEntity category);


    @Cacheable(value = {"category"},key = "#root.methodName")
    Map<String, List<Catelog2Vo>> getCatelogJson();

    Map<String, List<Catelog2Vo>> getCatelogJsons();
}

